package com.scb.api.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.scb.api.dao.impl.UserDaoImpl;
import com.scb.api.entity.User;
import com.scb.api.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	private static final Logger log = Logger.getLogger(UserServiceImpl.class);
	
	@Autowired
	private UserDaoImpl userDao;

	@Transactional(readOnly = true)
	public List<User> getAll() {
		log.info("UserService: /users/showall");
		
		return userDao.getAll();
	}

	public User getUserById(Long id) {
		return userDao.getUserById(id);
	}
}
